package com.swe.chums.dao.model;

import com.swe.chums.dao.*;
import com.swe.chums.dao.factory.*;
import com.swe.chums.dao.exceptions.*;
import java.io.Serializable;
import java.util.*;

public class Lessons implements Serializable
{
	/** 
	 * This attribute maps to the column id in the lessons table.
	 */
	protected int id;

	/** 
	 * This attribute maps to the column webresource_id in the lessons table.
	 */
	protected int webresourceId;

	/** 
	 * This attribute maps to the column title in the lessons table.
	 */
	protected String title;

	/** 
	 * This attribute maps to the column url in the lessons table.
	 */
	protected String url;

	/**
	 * Method 'Lessons'
	 * 
	 */
	public Lessons()
	{
	}

	/**
	 * Method 'getId'
	 * 
	 * @return int
	 */
	public int getId()
	{
		return id;
	}

	/**
	 * Method 'setId'
	 * 
	 * @param id
	 */
	public void setId(int id)
	{
		this.id = id;
	}

	/**
	 * Method 'getWebresourceId'
	 * 
	 * @return int
	 */
	public int getWebresourceId()
	{
		return webresourceId;
	}

	/**
	 * Method 'setWebresourceId'
	 * 
	 * @param webresourceId
	 */
	public void setWebresourceId(int webresourceId)
	{
		this.webresourceId = webresourceId;
	}

	/**
	 * Method 'getTitle'
	 * 
	 * @return String
	 */
	public String getTitle()
	{
		return title;
	}

	/**
	 * Method 'setTitle'
	 * 
	 * @param title
	 */
	public void setTitle(String title)
	{
		this.title = title;
	}

	/**
	 * Method 'getUrl'
	 * 
	 * @return String
	 */
	public String getUrl()
	{
		return url;
	}

	/**
	 * Method 'setUrl'
	 * 
	 * @param url
	 */
	public void setUrl(String url)
	{
		this.url = url;
	}

	/**
	 * Method 'equals'
	 * 
	 * @param _other
	 * @return boolean
	 */
	public boolean equals(Object _other)
	{
		if (_other == null) {
			return false;
		}
		
		if (_other == this) {
			return true;
		}
		
		if (!(_other instanceof Lessons)) {
			return false;
		}
		
		final Lessons _cast = (Lessons) _other;
		if (id != _cast.id) {
			return false;
		}
		
		if (webresourceId != _cast.webresourceId) {
			return false;
		}
		
		if (title == null ? _cast.title != title : !title.equals( _cast.title )) {
			return false;
		}
		
		if (url == null ? _cast.url != url : !url.equals( _cast.url )) {
			return false;
		}
		
		return true;
	}

	/**
	 * Method 'hashCode'
	 * 
	 * @return int
	 */
	public int hashCode()
	{
		int _hashCode = 0;
		_hashCode = 29 * _hashCode + id;
		_hashCode = 29 * _hashCode + webresourceId;
		if (title != null) {
			_hashCode = 29 * _hashCode + title.hashCode();
		}
		
		if (url != null) {
			_hashCode = 29 * _hashCode + url.hashCode();
		}
		
		return _hashCode;
	}

	/**
	 * Method 'createPk'
	 * 
	 * @return LessonsPk
	 */
	public LessonsPk createPk()
	{
		return new LessonsPk(id);
	}

	/**
	 * Method 'toString'
	 * 
	 * @return String
	 */
	public String toString()
	{
		StringBuffer ret = new StringBuffer();
		ret.append( "com.swe.chums.dto.Lessons: " );
		ret.append( "id=" + id );
		ret.append( ", webresourceId=" + webresourceId );
		ret.append( ", title=" + title );
		ret.append( ", url=" + url );
		return ret.toString();
	}

}
